import { ref } from 'vue'
import { defineStore } from "pinia";
export const useScrollStore = defineStore('scroll', () => {
    const scrollTop = ref<number>(0)                //当前滚动
    const mainScrollTop = ref<number>(0)            //主页滚动，用来返回主页时快速定位
    function storeMainScroll(){                     //存储主页滚动
        mainScrollTop.value = scrollTop.value
        console.log('存储成功',mainScrollTop.value);
    }
    return{scrollTop,mainScrollTop,storeMainScroll}
})